package com.itheima.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.itheima.po.User;
import com.itheima.dao.UserDao;
import com.itheima.service.UserService;
/**
 * 用户Service接口实现类
 */
@Service("UserService")
@Transactional
public class UserServiceImpl implements UserService{
	//注入UserDao
	@Autowired
	private UserDao userDao;
	//通过id查找用户
	@Override
    public User findUser(User user) {
    	user = userDao.findUser(user);
    	return user;
    }

	@Override
	public int register(User user) {
		return userDao.register(user);
	}
	@Override
	public int changeUserInfo(User user) {
		return userDao.changeUserInfo(user);
	}
	@Override
	public int changePassword(String userid,String password) {
		return userDao.changePassword(userid,password);
	}
	
	@Override
	public List<User> getUserList(User user) {
		// TODO Auto-generated method stub
		return userDao.getUserList(user);
	}

	@Override
	public int deleteUser(String userid) {
		// TODO Auto-generated method stub
		return userDao.deleteUser(userid);
	}
}
